---
layout: "default"
title: "_DestructorSafeContainer"
description: "Swift documentation for '_DestructorSafeContainer': A container is destructor safe if whether it may store to memory on."
keywords: "_DestructorSafeContainer,protocol,swift,documentation"
root: "/v1.2"
---

<div class="intro-declaration"><code class="language-swift">protocol _DestructorSafeContainer</code></div>

<div class="discussion comment">
    <p>A container is destructor safe if whether it may store to memory on
destruction only depends on its type parameters.
For example, whether Array&lt;T&gt; may store to memory on destruction depends
only on T.
If T is an Int we know the Array&lt;Int&gt; does not store to memory during
destruction. If T is an arbitrary class Array&lt;MemoryUnsafeDestructorClass&gt;
then the compiler will deduce may store to memory on destruction because
MemoryUnsafeDestructorClass&#39; destructor may store to memory on destruction.</p>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>



<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>









